package edu.zime.iot.controller;

import edu.zime.iot.entity.Course;
import edu.zime.iot.service.CourseService;
import edu.zime.iot.service.ScoreService;
import edu.zime.iot.util.GeneralResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.ArrayList;
import java.util.List;

public class ScoreController
{
//    @Autowired
//    private ScoreService scoreService;
//
//    @GetMapping("/scores")
//    public GeneralResponse scores()
//    {
//        GeneralResponse response=new GeneralResponse();
//        response.setSuccess(true);
//        response.setData(scoreService.getAllScores());
//        return response;
//    }
//    @PostMapping("/score/add")
//    public GeneralResponse add(@RequestParam String lesson, @RequestParam String teacher)
//    {
//        Scorce scorce=new Course();
//        score.setLesson(lesson);
//        score.setTeacher(teacher);
//
//        GeneralResponse response=new GeneralResponse();
//        response.setData(true);
//        response.setData(scoreService.add(score));
//        return response;
//    }
//    @PutMapping("/score/update")
//    public GeneralResponse update(@RequestParam String lesson,@RequestParam String teacher,@RequestParam int id)
//    {
//        Course course=new Course();
//        course.setId(id);
//        course.setLesson(lesson);
//        course.setTeacher(teacher);
//
//        GeneralResponse response=new GeneralResponse();
//        response.setSuccess(true);
//        response.setData(courseService.update(course));
//        return response;
//    }
//    @GetMapping("/score")
//    public GeneralResponse courseById(@RequestParam int id)
//    {
//        GeneralResponse response=new GeneralResponse();
//        response.setSuccess(true);
//        List<Course> result=new ArrayList<>();
//        result.add(courseService.getById(id));
//        response .setData(result);
//        return response;
//    }
}
